<template>
  <div id="app">
    <Node></Node>
    <!-- <h2 id="mlh" ref="mlh">茉莉花</h2>
    <User id="user" ref="user"></User>
    <Student :stuName="stuNane" :grade="grade" :cls="cls" :age="age" @updateName='updateName'></Student>
    <button @click="getDomElement">获取dom元素</button> -->
  </div>
</template>

<script>
import Student from "./components/Student.vue";
import User from "./components/User.vue";
import Notepad from './components/Notepad.vue';
export default {
  name: "App",
  components: {
    User,
    Student,
    Notepad,
  },
  data(){
    return {
      stuName:"凹凸",
      grade:"G5",
      cls:"三年二班",
      age:18,
    };
  },
  methods:{
    //获取dom元素
    getDomElement() {
      console.log(document.getElementById("mlh"));
      console.log("-----------------------------");
      console.log(this.$refs.User);
      console.log(this.$refs.user.name);
      console.log(this.$refs.user.show);
    },
    updateName(name,age) {
      this.stuName = name;
      this.age = age;
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
